package com.kaibes.web.thymeleaf;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.thymeleaf.spring5.view.ThymeleafViewResolver;

@Configuration
public class ThymeleafInit implements WebMvcConfigurer {

    @Resource(name="thymeleafViewResolver")
    private ThymeleafViewResolver thymeleafViewResolver;
    @Autowired
    private ThymeleafConfig thymeleafConfig;
    
    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        thymeleafViewResolver.setStaticVariables(thymeleafConfig.getStaticVariables());
    }
    
}
